﻿<%@ Page Language="C#" Title="mvc 测试页面" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="RDPCIPage.aspx.cs" Inherits="STHPMS1.Web.W_View.TestPage.RDPCIPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>

    <script type="text/javascript">      

        function RDPCIEdit(flag)
        {
            var row = $('#dg').datagrid('getSelected');
            var title="";
            if (flag == 0)
            {
                if (!row) {
                    $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
                    return;
                }
                $('#fm').form('load', row);
                title="新增测试数据";
            }
            else
            {
                $('#fm').form('clear');
                title="编辑测试数据";
            }

            $('#dlg').dialog('open');
        }

        function RDPCIDel() {
            var row = $('#dg').datagrid('getSelected');
            if (!row) {
                $.messager.alert('消息提示', '删除数据时，请选择一项!', 'warning');
                return;
            }

            deleteData($('#dg'), $('#dlg'), "/api/RDPCI");
        }



        function search(n,o) {
            var region = $('#cmbRegion').combobox("getValue");
            var direction = $('#cmbDirection').combobox("getValue");
            var checkDate = $('#checkDate').datebox('getValue');  //注意.datebox('getValue')

            var url = '/api/RDPCI';
            var urlParam = "";
            if (region != "" && region!="0") urlParam += "region=" + encodeURI(region) + "&";
            if (direction != "" && direction!="0") urlParam += "direction=" + encodeURI(direction) + "&";
            if (checkDate != "") urlParam += "checkDate=" + encodeURI(checkDate) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url:  url,pageNumber:1});
        }
       

        $(function () {
            var number= '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            dataGridBind($('#dg'), '/api/RDPCI', '测试数据列表显示', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

        
    </script>    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <th data-options="field:'SEGID',editor:'numberbox',width:80,align:'right' ">路段Id</th>
<th data-options="field:'DEVICE',editor:'checkbox',width:80,align:'right' ">设备</th>
<th data-options="field:'SURVTYPE',editor:'checkbox',width:80,align:'right' ">SURVTYPE</th>
<th data-options="field:'PCIDATE',editor:'datebox',width:80,align:'right' ">PCIDATE</th>
<th data-options="field:'PCILANE',editor:'checkbox',width:80,align:'right' ">PCILANE</th>
<th data-options="field:'PCIMAX',editor:'text',width:80,align:'right' ">PCIMAX</th>
<th data-options="field:'PCIMEAN',editor:'text',width:80,align:'right' ">PCIMEAN</th>
<th data-options="field:'PCIMIN',editor:'text',width:80,align:'right' ">PCIMIN</th>
<th data-options="field:'PCISTDDEV',editor:'text',width:80,align:'right' ">PCISTDDEV</th>
<th data-options="field:'NUMSAMP',editor:'numberbox',width:80,align:'right' ">NUMSAMP</th>
<th data-options="field:'FATCRK_AC',editor:'text',width:80,align:'right' ">FATCRK_AC</th>
<th data-options="field:'BLEED_AC',editor:'text',width:80,align:'right' ">BLEED_AC</th>
<th data-options="field:'BLOCK_AC',editor:'text',width:80,align:'right' ">BLOCK_AC</th>
<th data-options="field:'BUMPS_AC',editor:'text',width:80,align:'right' ">BUMPS_AC</th>
<th data-options="field:'CORR_AC',editor:'text',width:80,align:'right' ">CORR_AC</th>
<th data-options="field:'DEPRES_AC',editor:'text',width:80,align:'right' ">DEPRES_AC</th>
<th data-options="field:'EDGECRK_AC',editor:'text',width:80,align:'right' ">EDGECRK_AC</th>
<th data-options="field:'JTREFC_AC',editor:'text',width:80,align:'right' ">JTREFC_AC</th>
<th data-options="field:'LSDROP_AC',editor:'text',width:80,align:'right' ">LSDROP_AC</th>
<th data-options="field:'LTCRK_AC',editor:'text',width:80,align:'right' ">LTCRK_AC</th>
<th data-options="field:'PATCH_AC',editor:'text',width:80,align:'right' ">PATCH_AC</th>
<th data-options="field:'POLISH_AC',editor:'text',width:80,align:'right' ">POLISH_AC</th>
<th data-options="field:'PHOLES_AC',editor:'text',width:80,align:'right' ">PHOLES_AC</th>
<th data-options="field:'RRX_AC',editor:'text',width:80,align:'right' ">RRX_AC</th>
<th data-options="field:'RUT_AC',editor:'text',width:80,align:'right' ">RUT_AC</th>
<th data-options="field:'SHOVE_AC',editor:'text',width:80,align:'right' ">SHOVE_AC</th>
<th data-options="field:'SLPCRK_AC',editor:'text',width:80,align:'right' ">SLPCRK_AC</th>
<th data-options="field:'SWELL_AC',editor:'text',width:80,align:'right' ">SWELL_AC</th>
<th data-options="field:'RAVEL_AC',editor:'text',width:80,align:'right' ">RAVEL_AC</th>
<th data-options="field:'BLOWUP_PC',editor:'text',width:80,align:'right' ">BLOWUP_PC</th>
<th data-options="field:'CBRK_PC',editor:'text',width:80,align:'right' ">CBRK_PC</th>
<th data-options="field:'DSLAB_PC',editor:'text',width:80,align:'right' ">DSLAB_PC</th>
<th data-options="field:'DCRK_PC',editor:'text',width:80,align:'right' ">DCRK_PC</th>
<th data-options="field:'FAULT_PC',editor:'text',width:80,align:'right' ">FAULT_PC</th>
<th data-options="field:'JSDAM_PC',editor:'text',width:80,align:'right' ">JSDAM_PC</th>
<th data-options="field:'LSDROP_PC',editor:'text',width:80,align:'right' ">LSDROP_PC</th>
<th data-options="field:'LINCRK_PC',editor:'text',width:80,align:'right' ">LINCRK_PC</th>
<th data-options="field:'LPATCH_PC',editor:'text',width:80,align:'right' ">LPATCH_PC</th>
<th data-options="field:'SPATCH_PC',editor:'text',width:80,align:'right' ">SPATCH_PC</th>
<th data-options="field:'POLISH_PC',editor:'text',width:80,align:'right' ">POLISH_PC</th>
<th data-options="field:'POPOUT_PC',editor:'text',width:80,align:'right' ">POPOUT_PC</th>
<th data-options="field:'PUMP_PC',editor:'text',width:80,align:'right' ">PUMP_PC</th>
<th data-options="field:'POUT_PC',editor:'text',width:80,align:'right' ">POUT_PC</th>
<th data-options="field:'RRX_PC',editor:'text',width:80,align:'right' ">RRX_PC</th>
<th data-options="field:'MAPCRK_PC',editor:'text',width:80,align:'right' ">MAPCRK_PC</th>
<th data-options="field:'SHRCRK_PC',editor:'text',width:80,align:'right' ">SHRCRK_PC</th>
<th data-options="field:'CSPALL_PC',editor:'text',width:80,align:'right' ">CSPALL_PC</th>
<th data-options="field:'JSPALL_PC',editor:'text',width:80,align:'right' ">JSPALL_PC</th>

        </thead>
    </table>
   
    <!--测试数据命令-->
    <div id="tb">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="RDPCIEdit(-1)">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="RDPCIEdit(0)">编辑</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="RDPCIDel()">删除</a>
	    <input id="cmbRegion" class="easyui-combotree" style="width:300px" data-options="prompt:'行政区划',url:'/api/data/regioncode',method:'get',onChange:search"/>
	    <input id="checkDate" class="easyui-datebox"  data-options="prompt:'观测日期',onChange:search"/>
	    <select id="cmbDirection" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'调查方向',url:'/api/data/direction',method:'get',valueField:'id',textField:'text',onChange:search">
         </select>
    </div>

    <!--测试详细页面-->
    <div id="dlg" class="easyui-dialog" title="保存数据" style="width:320px;height:250px;padding:10px" closed="true"  data-options="
				iconCls: 'icon-save',
				buttons: '#dlg-buttons'
			">
        <form id="fm" method="post" action="/api/RDPCI">
            <table>
			     
        <tr>
            <td>路段Id:</td>
            <td><input name='SEGID' class='easyui-validatebox numberbox' /></td>
        </tr>

        <tr>
            <td>设备:</td>
            <td><input name='DEVICE' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>SURVTYPE:</td>
            <td><input name='SURVTYPE' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>PCIDATE:</td>
            <td><input name='PCIDATE' class='easyui-validatebox datebox' /></td>
        </tr>

        <tr>
            <td>PCILANE:</td>
            <td><input name='PCILANE' class='easyui-validatebox ' /></td>
        </tr>

        <tr>
            <td>PCIMAX:</td>
            <td><input name='PCIMAX' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PCIMEAN:</td>
            <td><input name='PCIMEAN' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PCIMIN:</td>
            <td><input name='PCIMIN' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PCISTDDEV:</td>
            <td><input name='PCISTDDEV' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>NUMSAMP:</td>
            <td><input name='NUMSAMP' class='easyui-validatebox numberbox' /></td>
        </tr>

        <tr>
            <td>FATCRK_AC:</td>
            <td><input name='FATCRK_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>BLEED_AC:</td>
            <td><input name='BLEED_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>BLOCK_AC:</td>
            <td><input name='BLOCK_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>BUMPS_AC:</td>
            <td><input name='BUMPS_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>CORR_AC:</td>
            <td><input name='CORR_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>DEPRES_AC:</td>
            <td><input name='DEPRES_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>EDGECRK_AC:</td>
            <td><input name='EDGECRK_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>JTREFC_AC:</td>
            <td><input name='JTREFC_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>LSDROP_AC:</td>
            <td><input name='LSDROP_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>LTCRK_AC:</td>
            <td><input name='LTCRK_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PATCH_AC:</td>
            <td><input name='PATCH_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>POLISH_AC:</td>
            <td><input name='POLISH_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PHOLES_AC:</td>
            <td><input name='PHOLES_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>RRX_AC:</td>
            <td><input name='RRX_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>RUT_AC:</td>
            <td><input name='RUT_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>SHOVE_AC:</td>
            <td><input name='SHOVE_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>SLPCRK_AC:</td>
            <td><input name='SLPCRK_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>SWELL_AC:</td>
            <td><input name='SWELL_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>RAVEL_AC:</td>
            <td><input name='RAVEL_AC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>BLOWUP_PC:</td>
            <td><input name='BLOWUP_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>CBRK_PC:</td>
            <td><input name='CBRK_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>DSLAB_PC:</td>
            <td><input name='DSLAB_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>DCRK_PC:</td>
            <td><input name='DCRK_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>FAULT_PC:</td>
            <td><input name='FAULT_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>JSDAM_PC:</td>
            <td><input name='JSDAM_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>LSDROP_PC:</td>
            <td><input name='LSDROP_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>LINCRK_PC:</td>
            <td><input name='LINCRK_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>LPATCH_PC:</td>
            <td><input name='LPATCH_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>SPATCH_PC:</td>
            <td><input name='SPATCH_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>POLISH_PC:</td>
            <td><input name='POLISH_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>POPOUT_PC:</td>
            <td><input name='POPOUT_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>PUMP_PC:</td>
            <td><input name='PUMP_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>POUT_PC:</td>
            <td><input name='POUT_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>RRX_PC:</td>
            <td><input name='RRX_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>MAPCRK_PC:</td>
            <td><input name='MAPCRK_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>SHRCRK_PC:</td>
            <td><input name='SHRCRK_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>CSPALL_PC:</td>
            <td><input name='CSPALL_PC' class='easyui-validatebox textbox' /></td>
        </tr>

        <tr>
            <td>JSPALL_PC:</td>
            <td><input name='JSPALL_PC' class='easyui-validatebox textbox' /></td>
        </tr>

		    </table>
        </form>
    </div>

    <!--编辑数据命令-->
    <div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:sumbitData($('#dg'),$('#dlg'))">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	</div>
</asp:Content>
